<?php
$view_post = '<div class="boxleft"><div class="titleleft"></div><div class="titlecenter"><a href="'.$row_menu_one['url'].'">'.$row_menu_one['name'].'</a></div><div class="titleright"></div><div class="titleicon"></div><div style="clear:both; height:5px"></div><div id="chuongtrinh"><h1>'.$row_menu_one['title'].'</h1><h2 style="color:#666; font-size:13px; font-weight:100; margin:0 20px; padding-bottom:30px">'.$row_menu_one['metaDescription'].'</h2>';

$thuvien2 = $tc->thuvien_sub($idMenu);
$total = mysql_num_rows($thuvien2);
if($total>0){
	while($row_thuvien2 = mysql_fetch_array($thuvien2)){
		if($row_thuvien2['type_id']==5) $view_post .= '<div class="item_img"><a href="'.$row_thuvien2['url'].'"><img src="'.url_danhmuc_image.$row_thuvien2['url_hinh'].'" alt="'.$row_thuvien2['name'].'"><h3 class="transparent_class">'.$row_thuvien2['name'].'</h3></a></div>';
		elseif($row_thuvien2['type_id']==6) $view_post .= '<div class="item_video"><a href="'.$row_thuvien2['url'].'"><img src="'.url_danhmuc_image.$row_thuvien2['url_hinh'].'" alt="'.$row_thuvien2['name'].'"><h3>'.$row_thuvien2['name'].'</h3></a></div>';
		else $view_post .= '<div class="item_img"><a href="'.$row_thuvien2['url'].'"><img src="'.url_danhmuc_image.$row_thuvien2['url_hinh'].'" alt="'.$row_thuvien2['name'].'"><h3 class="transparent_class">'.$row_thuvien2['name'].'</h3></a></div>';
	}
}else{
    $view_post .= '<link rel="stylesheet" href="library/slider_pic/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" />
	<div id="photos"><ul class="gallery clearfix">';
	$photo = $tc->PhotoAlbum($idMenu);
	while($row_photo = mysql_fetch_array($photo)) {
		$view_post .= "<li><a href='".url_library_image."{$row_photo[url_hinh]}' rel='prettyPhoto[gallery1]' title='{$row_photo[name]}'>
			<img border='0' class='img' src='".url_library_thumb_image."{$row_photo[url_hinh]}' alt='{$row_photo[name]}' /></a></li>";
	}
    $view_post .= '</ul></div><div style="clear:both; height:30px;"></div>
	<script src="library/slider_pic/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">$(document).ready(function(){$(".gallery a[rel^=\'prettyPhoto\']").prettyPhoto({theme:\'facebook\'});});</script>';
}

$view_post .= '</div><div style="clear:both; height:1px"></div></div>';
